package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Mysql struct {
	Username string
	Password string
	Host     string
	Port     int
	Dbname   string
}

type AppConfig struct {
	Mysql Mysql
}

var App *AppConfig

func Init() {
	viper.SetConfigFile("config/zy.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&App)
	fmt.Println("文件读取成功", App)
}
